<template>
  <view class="grid-box">
    <view class="grid-item" v-for="item in list" :key="item.id">
      <image class="icon" :src="item.icon" mode=""></image>
      <text class="text">{{ item.name }}</text>
    </view>
  </view>
</template>

<script setup lang="ts">
import type { CategoryItem } from '@/types'
defineProps<{
  list: CategoryItem[]
}>()
</script>

<style lang="scss">
.grid-box {
  margin-top: 20rpx;
  padding: 0 30rpx;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  min-height: 328rpx;

  .grid-item {
    width: 130rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    .icon {
      width: 100rpx;
      height: 100rpx;
    }

    .text {
      font-size: 26rpx;
      color: #666;
    }
  }
}
</style>
